<template>
    Father: {{ count }} --- {{ msg }} <br />
    <Son />
</template>

<script>
import { reactive, toRefs } from 'vue';
import Son from './component';

export default {
    components: {
        Son,
    },
    provide () {
        return {
            root: this,
        };
    },
    setup (props, context) {
        const state = reactive({
            count: 0,
            msg: 'zs',
        });
        const addCount = () => {
            console.log(1);
        };
        return {
            ...toRefs(state), addCount,
        };
    },
};
</script>

<style>

</style>
